<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/include/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>T短信群发</title>
<script type="text/javascript">

$(document).ready(function(){

	testMsgConfirm = function(){
		var msgText = $("#tempMsgText", navTab.getCurrentPanel()).val();
		var msgLength = msgText.lenth;
		var toNo = $("#tempToNo", navTab.getCurrentPanel()).val();
		alertMsg.confirm("测试消息内容如下：" +
				"<br><br>" + msgText +					
				"<br><br>发送消息长度：" + msgText.length + "字" + 				
				"<br>大约总条数：" + Math.ceil((msgText.length + 10)/63) + 				
				"<br>接收手机号：" + toNo +
				"<br>是否确认发送测试消息？", 
			{
				okCall: function(){

					$("#msgText", navTab.getCurrentPanel()).val(msgText);
					$("#form",navTab.getCurrentPanel()).attr("action","msg/sendSingleMsg.do?funId=${funId}");
					validateCallback($("#form",navTab.getCurrentPanel()), navTabAjaxDone);
				},
				cancelCall : function() {
					return false;
				}
			});
		return false;
	
	};

	sendMsgConfirm = function(){
		var msgText = $("#tempMsgText", navTab.getCurrentPanel()).val();
		var msgLength = msgText.lenth;
		var phoneNumQty = 1;
		alertMsg.confirm("群发消息内容如下：" +
				"<br><br>" + msgText +					
				"<br><br>发送消息长度：" + msgText.length + "字" + 		
				"<br>接收手机数量：" + phoneNumQty +
				"<br>大约总条数：" + Math.ceil((msgText.length + 10)/63) * phoneNumQty + 		
				"<br>是否确认群发消息？", 
			{
				okCall: function(){

					$("#msgText", navTab.getCurrentPanel()).val(msgText);
					$("#form",navTab.getCurrentPanel()).attr("action","msg/sendBatchMsg.do?funId=${funId}");
					validateCallback($("#form",navTab.getCurrentPanel()), navTabAjaxDone);
				},
				cancelCall : function() {
					return false;
				}
			});
		return false;
	};
	
	
});


</script>
</head>
<body>
		<div class="pageContent"  layoutH="35">
			
			<div class="pageHeader" layoutH="48">
				<form id="form" onsubmit="return navTabSearch(this);" action="" method="post">
					<div class="searchBar">
						<table class="searchContent">
							<tr>
								<td>	
								  手机号码:
				       			</td>
				       			
								<td>(请录入待发送的手机号码，手机号以英文逗号或回车换行符分隔)
				       			</td>
				       			
							</tr>
							<tr>
								<td>	
				       			</td>
							
								<td>
								<textarea class="textInput" name="phoneNos" id="phoneNos" maxlength="480"cols="120" rows="25"></textarea>
				       			</td>
							</tr>
						</table><!-- 
			       		<div class="subBar">
							<ul>
								<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
							</ul>
						</div> -->
					</div>
				</form>
			</div>
		</div>
		
		<div class="formBar">
			<ul>
				<li>短信内容：<input id="tempMsgText" value="" size="100"/></li>
				<li>测试号码：<input id="tempToNo" value="" size="11"/></li>
				<li><div class="button"><div class="buttonContent"><button type="submit" onclick="return testMsgConfirm();">测试</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="submit" onclick="return sendMsgConfirm();">发送</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li>
			</ul>
		</div>



</body>
</html>


